<!DOCTYPE html>
<html>
    <head>
        
    </head>


    <body>
        <div>html</div>
        <input id="input_text"/>
        <button onclick="onSendText()">传递数据给android</button>

        <div>
            <p>来自android的数据：</p>
            <span id="result"></span>
        </div>
        <script type="text/javascript">
            var Bridge = {};
            //接收来自java的数据
            Bridge.onSend4Java = function(text) {
                console.log("sss " + text)
                var result = document.getElementById("result")
                result.innerHTML = text
            }

            //发生数据到java
            function onSendText() {
                var element = document.getElementById("input_text")
                var values = element.value
                window.Bridge2.onSend4Js(values)
            }
        </script>
    </body>
</html>